#ifndef __DRIVER_24BYJ48_H
#define __DRIVER_24BYJ48_H


#include "stdint.h"

#include "main.h"
#include "gpio.h"




typedef struct Driver_24BYJ48
{
	void (*writeA)(uint8_t x);
	void (*writeB)(uint8_t x);
	void (*writeC)(uint8_t x);
	void (*writeD)(uint8_t x);
}Motor;

extern Motor A;
/* 电机D1各引脚的电平改变函数 */
void D1_1_Write(uint8_t x);
void D1_2_Write(uint8_t x);
void D1_3_Write(uint8_t x);
void D1_4_Write(uint8_t x);
/* 电机D2各引脚的电平改变函数 */
void D2_1_Write(uint8_t x);
void D2_2_Write(uint8_t x);
void D2_3_Write(uint8_t x);
void D2_4_Write(uint8_t x);
/* 电机D3各引脚的电平改变函数 */
void D3_1_Write(uint8_t x);
void D3_2_Write(uint8_t x);
void D3_3_Write(uint8_t x);
void D3_4_Write(uint8_t x);
/* 电机D4各引脚的电平改变函数 */
void D4_1_Write(uint8_t x);
void D4_2_Write(uint8_t x);
void D4_3_Write(uint8_t x);
void D4_4_Write(uint8_t x);
/* 电机D5各引脚的电平改变函数 */
void D5_1_Write(uint8_t x);
void D5_2_Write(uint8_t x);
void D5_3_Write(uint8_t x);
void D5_4_Write(uint8_t x);
void Motor8_Init(Motor *motor,void (*Dx_1)(uint8_t x),void (*Dx_2)(uint8_t x),void (*Dx_3)(uint8_t x),void (*Dx_4)(uint8_t x));
void Motor8(Motor *motor,uint8_t i,uint8_t dir);


#endif

